package com.orange.commons;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 描述：统计项目的返回数据对象
 * code
 * msg
 * count
 * data[]
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {

    @JsonIgnore
    public static Result USER_ADD_SUCCESS= new Result(200,"添加成功");
    @JsonIgnore
    public static Result USER_ADD_ERROR= new Result(-1,"添加失败");

    @JsonIgnore
    public static Result USER_UPDATE_SUCCESS= new Result(200,"修改成功");
    @JsonIgnore
    public static Result USER_UPDATE_ERROR= new Result(-1,"修改失败");

    @JsonIgnore
    public static Result USER_DEL_SUCCESS= new Result(200,"删除成功");
    @JsonIgnore
    public static Result USER_DEL_ERROR= new Result(-1,"删除失败");

    @JsonIgnore
    public static Result USER_OPT_SUCCESS= new Result(200,"操作成功");
    @JsonIgnore
    public static Result USER_OPT_ERROR= new Result(-1,"操作失败");



    private Integer code=0;
    private String msg="";
    private Long count=0L;
    private Object data;

    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
